﻿using furion.blog.Domain.MySQL;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Domain.Query
{
    public abstract class BaseDetailQuery <T> where T : BaseModel
    {
        /// <summary>
        /// 模糊查询
        /// </summary>
        public bool FuzzyQuery { get; set; } = false;

        /// <summary>
        /// 默认返回十条数据
        /// </summary>
        public int Top { get; set; } = 10;

        /// <summary>
        /// 查询条件
        /// </summary>
        /// <returns></returns>
        public abstract Expression<Func<T, bool>> Exp();

        public virtual string[] IgnoreColumns() {
            return new string[] { };
        }

        public virtual (Expression<Func<T, object>>,OrderByType) OrderBy() {
            return ((t) => t.Ts, OrderByType.Desc);
        }

        

    }
}
